﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Guedes_Library;
using System.Data;

/// <summary>
/// Summary description for NoticiaModel
/// </summary>
public class NewsletterModel:GuedesModel<news_lt>
{
    private EntityKey entityKey;

    public NewsletterModel()
	{

	}

    public void Salvar(news_lt news_lt)
    {
        entityKey = new EntityKey("guedesEntities.news_lt", "ID", news_lt.ID);
        Save(news_lt, entityKey);
    }

    public List<news_lt> ListarNoticias()
    {
        return SelectAll();
    }

    public override void DoChanges(news_lt entity, news_lt novo)
    {
        entity.Name = novo.Name;
        entity.e_mail = novo.e_mail;
    }

    public override string GetKeyTabela()
    {
        return "ID";
    }

    public override string GetTabela()
    {
        return "guedesEntities.news_lt";
    }
}